package com.qf.lanzhou.blog.api.controller;

import com.qf.lanzhou.blog.api.pojo.entity.Article;
import com.qf.lanzhou.blog.api.service.DeleteArticleService;
import com.qf.lanzhou.blog.api.service.impl.DeleteArticleServiceImpl;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @Author Nerly
 * @Date 2020/12/21 16:55
 * @JDK 1.8
 * @Version 1.0
 */
@WebServlet("/deleteArticle.do")
public class DeleteArticleServlet extends BaseServletPost {
    private DeleteArticleService deleteArticleService = new DeleteArticleServiceImpl();

    @Override
    protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        Article article = paramsToEntity(req, Article.class);
        deleteArticleService.deleteArticle(article);
    }
}
